/**
 * Created by yangyan on 17/11/1.
 */
//    弹框提示
function dialog(d,time){
    if(document.getElementById("dialog")){
        document.getElementById("dialog").innerHTML = d;
        document.getElementById("dialog").style.display = "block";
    }else{
        var dialog  = document.createElement("div");
        dialog.id = "dialog";
        dialog.className = "dialog";
        dialog.innerHTML = d;
        document.getElementsByTagName("body")[0].appendChild(dialog);
    };
    setTimeout(function(){
        var dialog = document.getElementById("dialog");
        if(dialog){
            document.getElementById("dialog").style.display = "none";
        }
    }, time || 2000);
}